TaskUpdate.prototype.done_action = function() {
   // Check access with Update.canEdit()-function
   if (this.canEdit()) {
      this.finishedDate = new Date();
      
      this.creator.tasks.removeChild(this);
      this.creator.finished.add(this);
      
      res.redirect(this.creator.href());
   }
}

TaskUpdate.prototype.undo_action = function() {
   // Check access with Update.canEdit()-function
   if (this.canEdit()) {
      // collections get an automatic refresh!
      // but be careful if you use collection.cachemode=aggressive
      this.finishedDate = null;
      
      this.creator.tasks.add(this);
      this.creator.finished.removeChild(this);
      
      res.redirect(this.creator.href());
   }
}
